tywx.NotificationCenter = {
    events: {},
    listen: function(t, e, n) {
        this.events[t] = this.events[t] || [], this.events[t].push({
            scope: n || this,
            handler: e
        });
    },
    ignore: function(t, e, n) {
        n = n || this;
        var i = this.events[t];
        i && (this.events[t] = i.filter(function(t) {
            return t.scope != n || t.handler != e;
        }));
    },
    ignoreScope: function(t) {
        for (var e in this.events) {
            var n = this.events[e];
            n && (this.events[e] = n.filter(function(n) {
                return n.scope != t || (tywx.LOGD("tywx.NotificationCenter", "ty.NotificationCenter : remove listener by Scope: " + e), 
                !1);
            }));
        }
    },
    trigger: function(t, e) {
        var n = this.events[t];
        if (n) for (var i, s = Array.prototype.slice.call(arguments, 1), r = 0; r < n.length; r++) (i = n[r]) && i.handler.apply(i.scope, s);
    }
};